import React,{Component} from 'react'
import {View,Text,StyleSheet,TouchableOpacity} from 'react-native'

export default class Home extends Component{

    static navigationOptions={
        title:'home',
        headerTitle:'home2',
        headerBackTitle:'返回',
        headerTitleStyle:{color:'white'},
        headerStyle:{backgroundColor:'red'}
   
    };

    constructor(props){
        super(props);
        this.state={
            zhi:'1',
        }
    }


     _nextPage=()=>{
         this.props.navigation.navigate('Home2',{id:'321321',pro:this.getpro})
     }

     getpro=(dd)=>{
         console.log('调用');
         this.setState({zhi:dd})
     }
   

    render(){
        return(
            <View style={{flex:1,backgroundColor:'#fff',alignItems:'center'}}>
            <Text style={{marginTop:50}}>Home</Text>
            <Text style={{marginTop:100}}>{this.state.zhi}</Text>
            <TouchableOpacity style={{marginTop:50,height:40}} onPress={this._nextPage}>
            <Text>点击</Text>
            </TouchableOpacity>
                </View>
        )
    }
}

const myStyle=StyleSheet.create({

})